import { Column, Entity, Index } from 'typeorm';
import { CommonEntity } from '~/common/entity/common.entity';
import { ModuleTypeEnums } from '~/constants/modules.constant';

@Entity('ah_share')
@Index(['id'])
export class ShareEntity extends CommonEntity {
  // 分享者
  @Column({ type: 'varchar', length: 255, comment: '分享标题', nullable: true, default: null })
  title: string;

  @Column({ type: 'text', comment: '分享内容', nullable: true, default: null })
  content: string;

  @Column({
    type: 'tinyint',
    width: 1,
    comment: '分享类型',
    default: ModuleTypeEnums.SYSTEM,
  })
  type: ModuleTypeEnums;

  @Column({ type: 'int', comment: '关联ID', name: 'relation_id' })
  relationId: number;
}
